package string;

public class StringPractice {
    public static void main(String[] args) {
        String str="      我叫cxk，练习时长两年半，喜欢唱跳Rap篮球     ";
        int len=str.length();//1
        System.out.println(len);
        String str1=str.trim();//2
        System.out.println(str1);
        String str2=str1.toUpperCase();//3
        System.out.println(str2);
        String str3=str1.toLowerCase();
        System.out.println(str3);
        boolean b=str1.startsWith("cxk");//4
        boolean a=str1.endsWith("篮球");
        System.out.println(a);
        System.out.println(b);
        char chr=str1.charAt(10);//5
        System.out.println(chr);
        int start=str1.indexOf("，");//6
        int end=str1.lastIndexOf("，");
        System.out.println(start);
        System.out.println(end);
        String str4=str1.substring(start+1,end);//7
        System.out.println(str4);

        double num=3.1415;
        String str5=String.valueOf(num);//8
        System.out.println(str5);



    }
}
